using UnityEngine;
using UnityEngine.EventSystems;

namespace MaterialUI
{
	[AddComponentMenu("MaterialUI/Tab Pages Scroll Detector", 100)]
	public class TabPagesScrollDetector : MonoBehaviour, IDragHandler, IEndDragHandler, IEventSystemHandler
	{
		[SerializeField]
		private TabView m_TabView;

		public TabView tabView
		{
			get
			{
				return m_TabView;
			}
			set
			{
				m_TabView = value;
			}
		}

		public void OnDrag(PointerEventData eventData)
		{
			m_TabView.TabPageDrag();
		}

		public void OnEndDrag(PointerEventData eventData)
		{
			TabView tabView = m_TabView;
			Vector2 delta = eventData.delta;
			tabView.TabPagePointerUp(delta.x);
		}
	}
}
